# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

pkgname=srsgui
_pkgname=srsGUI
pkgver=2.0
_tag=release_${pkgver/./_}_qt5
pkgrel=2
pkgdesc='A graphics library for software radio'
arch=('loong64' 'x86_64')
url='https://github.com/srsLTE/srsGUI'
license=('AGPL3')
depends=('boost-libs' 'qt5-base' 'qwt')
makedepends=('cmake' 'boost')
source=("$_pkgname-$pkgver.tar.gz::$url/archive/$_tag.tar.gz"
         srsgui-qwt-6.2.patch)
sha512sums=('9d766a80fc81b015f5c8dbed3fa97d417496a0e4db11bd23a66bae4c3a2d7e0206f2569af8884d01b40702416dab6add52cc0ef04f29b176aba99de00466a88d'
            '1097681e57d0548db36db9ab1331e6e96554b44618b21ee08631e188e092796d57ec49c0456055b633026246eb652f75cd7470c60bb530ebf246d92cd9f28b5e')

prepare() {
  patch -d $_pkgname-$_tag -p1 < srsgui-qwt-6.2.patch # Fix build with qwt 6.2
}

build() {
  mkdir $_pkgname-$_tag/build
  cd $_pkgname-$_tag/build

  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DQWT_NAMES=qwt

  make
}

package() {
  cd $_pkgname-$_tag/build

  make DESTDIR="$pkgdir" install
}

